package com.example.oms.controller;

import com.example.oms.manager.DailyQueueManager;
import com.example.oms.utils.DataResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("test")
public class TestController {
    @Resource
    private DailyQueueManager queueManager;
    @GetMapping("/initQueue")
    public DataResult initQueue(){
        queueManager.initializeDailyQueues();
        return new DataResult(200,null,"队列初始化成功");
    }
    @GetMapping("/getQueue")
    public DataResult getQueue(@RequestParam int id){
        return new DataResult(200,queueManager.getQueue(id),"队列初始化成功");
    }
}
